figure;
for site=1:size(proj_meta,2)
no_time_points = size(proj_meta(site).rd,2);

act=[];
type_sessions={'f','p','d'};
mean_act=[];
sem_act=[];
for tp=1:no_time_points
    act=[];
    for lyr=1:4
        act=[act; proj_meta(site).rd(lyr,tp).act];
    end
%     act = calc_dFF(act);
    act = mean(act,1);
    temp=proj_meta(site).rd(lyr,tp).nbr_frames;
    temp=cumsum(temp);
    temp=[1 temp+1];
    velM = proj_meta(site).rd(lyr,tp).velM_smoothed;
    velP = proj_meta(site).rd(lyr,tp).velP_smoothed;
    for k = 1:length(type_sessions)
        ac_sess=find(strcmp(proj_meta(site).rd(lyr,tp).session,type_sessions(k))==1);
        indices=[];
        for kk=1:length(ac_sess)
            indices=[indices temp(ac_sess(kk)):temp(ac_sess(kk)+1)-1];
        end
        temp2=act(indices);
        mean_act(tp,k)=mean(temp2);
        sem_act(tp,k)=std(temp2)/sqrt(length(temp2));

    end
end


colors=[0 0 1;0 0 1;1 0 0;1 0 0;0 0 0;0 0 0;0 0 0;0 0 0;0 0 0;0 0 0;];
set(0,'DefaultAxesColorOrder',colors(1:no_time_points,:));
subplot(3,2,site);plot(mean_act','o-')
title([proj_meta(site).animal ' - ' num2str(proj_meta(site).ExpGroup(1))]);
end